<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@page import ="com.dish.bean.Order,java.util.*" %>  
  
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
  <head>
    <title>肯德鸭-订单管理</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- Main CSS-->
    <link rel="stylesheet" type="text/css" href="css/main.css">
    <!-- Font-icon css-->
    <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
  </head>
  <body class="app sidebar-mini rtl">
    <!-- Navbar-->
    <header class="app-header"><a class="app-header__logo" href="#">Kendeya</a>
      <!-- Sidebar toggle button--><a class="app-sidebar__toggle" href="#" data-toggle="sidebar" aria-label="Hide Sidebar"></a>
      <!-- Navbar Right Menu-->
      <ul class="app-nav">
        <!--Notification Menu-->
       
        <!-- User Menu-->
      </ul>
    </header>
    <!-- Sidebar menu-->
    <div class="app-sidebar__overlay" data-toggle="sidebar"></div>
    <aside class="app-sidebar">

      <ul class="app-menu">
        <li class="treeview is-expanded"><a class="app-menu__item" href="#" data-toggle="treeview"><i class="app-menu__icon fa fa-th-list"></i><span class="app-menu__label">管理界面</span><i class="treeview-indicator fa fa-angle-right"></i></a>
          <ul class="treeview-menu">
         	<li><a class="treeview-item" href="ShowUsers"><i class="icon fa fa-circle-o"></i> 用户管理</a></li>
            <li><a class="treeview-item" href="ShowDish"><i class="icon fa fa-circle-o"></i> 菜品管理</a></li>
            <li><a class="treeview-item active" href="ShowOrder"><i class="icon fa fa-circle-o"></i> 订单管理</a></li>
          </ul>
        </li>
      </ul>
    </aside>
    <main class="app-content">
      <div class="app-title">
        <div>
          <h1><i class="fa fa-th-list"></i>&nbsp;&nbsp;订单管理</h1>
        </div>
      </div>
      <div class="row">
        <div class="col-md-12">
          <div class="tile">
            <div class="tile-body">
              <table class="table table-hover table-bordered" id="sampleTable">
                <thead>
                  <tr>
                    <th>订单ID</th>
                    <th>用户ID</th>
                    <th>联系人</th>
                    <th>联系方式</th>
                    <th>联系地址</th>
                    <th>下单时间</th>
                    <th>商品明细</th>
                    <th>总价</th>
                    <th>是否付款</th>
                    <th>是否送达</th>
                    <th>操作</th>
                  </tr>
                </thead>
                <%ArrayList<Order> list = (ArrayList<Order>)request.getAttribute("lst"); %>
				
                <tbody>
                <%for(Order i:list){%>
                  <tr>
                    <td><%=i.getOrderid() %></td>
                    <td><%=i.getUserid() %></td>
					<td><%=i.getUsernm() %></td>
                    <td><%=i.getPhonenumber() %></td>
                    <td><%=i.getAddress() %></td>
                    <td><%=i.getCreatedate() %></td>
                    <td><%=i.getItems() %></td>
                    <td><%=i.getTotalprice() %></td>
                    <td><%=i.getIspay() %></td>
                    <td><%=i.getIssend() %></td>
                    <td>
                        <a onClick="return window.confirm('您确定要将<%=i.getOrderid()%>号订单设置为已支付？')" href="setpay.jsp?id=<%=i.getOrderid()%>">确认支付</a>
						<a onClick="return window.confirm('您确定要删除<%=i.getOrderid()%>号订单设置为已送达？')" href="setsend.jsp?id=<%=i.getOrderid()%>">确认送达</a>
					</td>
                  </tr>
                   <% } %>
                </tbody>
               
              </table>
            </div>
          </div>
        </div>
      </div>
    </main>
    <!-- Essential javascripts for application to work-->
    <script src="js/jquery-3.2.1.min.js"></script>
    <script src="js/popper.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/main.js"></script>
    <!-- The javascript plugin to display page loading on top-->
    <script src="js/plugins/pace.min.js"></script>
    <!-- Page specific javascripts-->
    <!-- Data table plugin-->
    <script type="text/javascript" src="js/plugins/jquery.dataTables.min.js"></script>
    <script type="text/javascript" src="js/plugins/dataTables.bootstrap.min.js"></script>
    <script type="text/javascript">$('#sampleTable').DataTable();</script>
    <!-- Google analytics script-->
    <script type="text/javascript">
      if(document.location.hostname == 'pratikborsadiya.in') {
      	(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      	(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      	m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      	})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
      	ga('create', 'UA-72504830-1', 'auto');
      	ga('send', 'pageview');
      }
    </script>
  </body>
</html>